package com.dai.design.liskovsutiution.bird;

/**
 * @author daijiyong
 */
public class LSPTest {
    public static void main(String[] args) {
        Bird bird1 = new Swallow();
        Bird bird2 = new BrownKiwi();
        bird1.setSpeed(120);
        bird2.setSpeed(120);
        System.out.println("假设飞了120公里：");
        try {
            System.out.println("燕子将飞行" + bird1.getFlyTime(120) + "小时.");
            System.out.println("几维鸟将飞行" + bird2.getFlyTime(120) + "小时。");
        } catch (Exception err) {
            System.out.println("发生错误了!");
        }
    }
}
